package com.example.communist_app_api.Schedule;

import com.example.communist_app_api.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author Brother Sheng Editor
 * @version 1.0
 * Create by 2023/3/2 9:54
 */
@Component
public class RefreshMessageBoard {

    @Autowired
    private MessageService messageService;

    /**
     * 每5分钟触发任务
     */
//    @Scheduled(cron = "0 0/5 * * * ? ")
//    public void refreshMessageBoard() {
//        messageService.refresh();
//        System.out.println("留言板于："+System.currentTimeMillis()+" 更新了！");
//    }
}
